From deede8ccfe30163aebdc29f5b7fb2103396bfeef Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 31 Jul 2025 11:49:20 +0200 Subject: [PATCH] Set debug names for swipe tracker pan gestures Add a debug name param to swipe trackers to make gestures debugging that sets the ClutterAction 'name' param of the pan gesture. This should make debugging gestures easier when SwipeTrackers are involved. Part-of: --- js/ui/appDisplay.js | 6 +++++- js/ui/keyboard.js | 6 +++++- js/ui/overview.js | 1 + js/ui/swipeTracker.js | 3 ++- js/ui/unlockDialog.js | 5 ++++- js/ui/workspaceAnimation.js | 1 + js/ui/workspacesView.js | 5 ++++- 7 files changed, 22 insertions(+), 5 deletions(-) diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js index fd75fb2d3..b6479ae17 100644 --- a/js/ui/appDisplay.js +++ b/js/ui/appDisplay.js @@ -606,7 +606,11 @@ var BaseAppView = GObject.registerClass({ // Swipe this._swipeTracker = new SwipeTracker.SwipeTracker(this._scrollView, - Clutter.Orientation.HORIZONTAL, this.gestureModes); + Clutter.Orientation.HORIZONTAL, + this.gestureModes, + { + name: 'AppDisplay swipe tracker', + }); this._swipeTracker.orientation = Clutter.Orientation.HORIZONTAL; this._swipeTracker.connect('begin', this._swipeBegin.bind(this)); this._swipeTracker.connect('update', this._swipeUpdate.bind(this)); diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 15461e891..e3c8cd07a 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -620,7 +620,11 @@ const EmojiPager = GObject.registerClass({ const swipeTracker = new SwipeTracker.SwipeTracker(this, Clutter.Orientation.HORIZONTAL, Shell.ActionMode.NORMAL | Shell.ActionMode.OVERVIEW, - {allowDrag: true, allowScroll: true}); + { + allowDrag: true, + allowScroll: true, + name: 'EmojiPager swipe tracker', + }); swipeTracker.connect('begin', this._onSwipeBegin.bind(this)); swipeTracker.connect('update', this._onSwipeUpdate.bind(this)); swipeTracker.connect('end', this._onSwipeEnd.bind(this)); diff --git a/js/ui/overview.js b/js/ui/overview.js index 5dbd181de..1a22e2cdf 100644 --- a/js/ui/overview.js +++ b/js/ui/overview.js @@ -234,6 +234,7 @@ export class Overview extends Signals.EventEmitter { { allowDrag: false, allowScroll: false, + name: 'Overview swipe tracker', phase: Clutter.EventPhase.CAPTURE, }); swipeTracker.orientation = Clutter.Orientation.VERTICAL; diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js index a911d034a..f95574c3b 100644 --- a/js/ui/swipeTracker.js +++ b/js/ui/swipeTracker.js @@ -370,6 +370,7 @@ export const SwipeTracker = GObject.registerClass({ allowDrag: true, allowScroll: true, phase: Clutter.EventPhase.BUBBLE, + name: 'SwipeTracker', }); super._init(); @@ -402,7 +403,7 @@ export const SwipeTracker = GObject.registerClass({ ? Clutter.PanAxis.X : Clutter.PanAxis.Y, ], null); - actor.add_action_full('SwipeTracker', params.phase, this._panGesture); + actor.add_action_full(params.name, params.phase, this._panGesture); this._touchpadGesture = new TouchpadSwipeGesture(allowedModes); this._touchpadGesture.connect('begin', this._beginTouchpadGesture.bind(this)); diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index 163d16fa0..63ba591ee 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -545,7 +545,10 @@ export const UnlockDialog = GObject.registerClass({ this._swipeTracker = new SwipeTracker.SwipeTracker(this, Clutter.Orientation.VERTICAL, - Shell.ActionMode.UNLOCK_SCREEN); + Shell.ActionMode.UNLOCK_SCREEN, + { + name: 'UnlockDialog swipe tracker', + }); this._swipeTracker.connect('begin', this._swipeBegin.bind(this)); this._swipeTracker.connect('update', this._swipeUpdate.bind(this)); this._swipeTracker.connect('end', this._swipeEnd.bind(this)); diff --git a/js/ui/workspaceAnimation.js b/js/ui/workspaceAnimation.js index 70e24fb45..11cd7eedd 100644 --- a/js/ui/workspaceAnimation.js +++ b/js/ui/workspaceAnimation.js @@ -332,6 +332,7 @@ export class WorkspaceAnimationController { { allowDrag: false, phase: Clutter.EventPhase.CAPTURE, + name: 'WorkspaceAnimation swipe tracker', }); swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this)); swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this)); diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index a4d9c979c..635d04cc4 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -840,7 +840,10 @@ class WorkspacesDisplay extends St.Widget { Main.layoutManager.overviewGroup, Clutter.Orientation.HORIZONTAL, Shell.ActionMode.OVERVIEW, - {allowDrag: false}); + { + allowDrag: false, + name: 'WorkspacesView swipe tracker', + }); this._swipeTracker.allowLongSwipes = true; this._swipeTracker.connect('begin', this._switchWorkspaceBegin.bind(this)); this._swipeTracker.connect('update', this._switchWorkspaceUpdate.bind(this)); -- 2.39.5